<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<title>{$weicard[name]}的微名片</title>
	<meta name="viewport" content="width=device-width, user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" media="screen" href="../addons/amouse_weicard/ui/css/cardMobile.css?r9590">
</head>
<body>
	<div class="layout1">
		
		<div class="name" style="">
			<div class="no-topImg"></div>
			<div class="avator" style="background-image:url({$weicard[headimg]});"></div>
			<h1>{$weicard[name]}</h1>
			<p>
                {$weicard[department]}|{$weicard[job]}</p>
		</div>
		<ul class="list">
			<li class="unitName" data-longinfo="单位名称" data-adjustHeight="unitName">
				<i class="icon-office"></i>
				<span>{$weicard['company']}</span>
			</li>
			<li class="mobilePhone" data-tel="{$weicard['mobile']}">
				<i class="icon-mobile"></i>
				<span>{$weicard['mobile']}</span>
			</li>

			<li class="email" data-mail="{$weicard['email']}">
				<i class="icon-mail"></i>
				<span>{$weicard['email']}</span>
			</li>
            {if $weicard[weixin]}
            <li class="weixin">
                <i class="icon-weixin"></i>
                <span>{$weicard['weixin']}</span>
            </li>
            {/if}
            {if $weicard[qq]}
			<li class="qq" data-qq="{$weicard['qq']}">
				<i class="icon-qq"></i>
				<span>{$weicard['qq']}</span>
			</li>
            {/if}
            {if $weicard[address]}
            <li class="cardAddress" data-url data-adjustHeight="address">
                <i class="icon-location"></i>
                <span>{$weicard[address]}</span>
            </li>
            {/if}
		</ul>
        
        <div class="handka-copyright">
            <p>技术支持:
                <a href="{$setting['guanzhuUrl']}">
                    {if empty($setting['copyright'])}{$_W['account']['name']} {else}{$setting['copyright']}{/if}
                </a>
            </p>
        </div>
        
		<div class="bottom">
			<!--<span class="download-vcf"><i class="icon-download"></i>保存到电话薄</span>
			<span class="website" data-url="http://www.handka.com/apps/app1427863570093"><i class="icon-home"></i>
				官方微站
			</span>-->
			<span class="show-qr-button"><i class="icon-qrcode"></i>显示二维码</span>
			<span class="wx-shareto"><i class="icon-pencil"></i>我要制作</span>
		</div>
		<div class="show-qr" align="center">
            <img src="{php echo $this->getQRImage2($weicard['id'],$weicard['openid'] );}" style="height:80%; width:80%;"/>
			<i class="icon-cancel-circle"></i>
		</div>
		<div class="tip-shareto">
			<img src="../addons/amouse_weicard/ui/images/tip-shareto.png" />
			<i class="icon-cancel-circle"></i>
		</div>
		<div class="tip-nosite" style="background-image:url(../addons/amouse_weicard/ui/images/tip-nosite.png)">
			<i class="icon-cancel-circle"></i>
		</div>
		<div class="tip-longinfo" data-block="longInfo">
			<div>
				<h3></h3>
			    <p></p>
			</div>
			<i class="icon-cancel-circle" data-action="closeTip"></i>
		</div>
	</div>
    <script type="text/javascript" src="../addons/amouse_weicard/ui/js/ender-card-mobile.min.js?r9590"></script>
<script type="text/javascript">
!function(a,b){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return b(a)}):b(a,!0)}(this,function(a,b){function c(b,c,d){a.WeixinJSBridge?WeixinJSBridge.invoke(b,e(c),function(a){h(b,a,d)}):k(b,d)}function d(b,c,d){a.WeixinJSBridge?WeixinJSBridge.on(b,function(a){d&&d.trigger&&d.trigger(a),h(b,a,c)}):d?k(b,d):k(b,c)}function e(a){return a=a||{},a.appId=A.appId,a.verifyAppId=A.appId,a.verifySignType="sha1",a.verifyTimestamp=A.timestamp+"",a.verifyNonceStr=A.nonceStr,a.verifySignature=A.signature,a}function f(a,b){return a=a||{},a.scope=b,a.signType="sha1",a.timeStamp=a.timestamp+"",a.nonceStr=a.nonceStr,a.addrSign=a.addrSign,a}function g(a){return a=a||{},a.timeStamp=a.timestamp+"",a.nonceStr=a.nonceStr,a.package=a.package,a.paySign=a.paySign,a.signType="SHA1",a}function h(a,b,c){var d,e,f;switch(delete b.err_code,delete b.err_desc,delete b.err_detail,d=b.errMsg,d||(d=b.err_msg,delete b.err_msg,d=i(a,d,c),b.errMsg=d),c=c||{},c._complete&&(c._complete(b),delete c._complete),d=b.errMsg||"",A.debug&&!c.isInnerInvoke&&alert(JSON.stringify(b)),e=d.indexOf(":"),f=d.substring(e+1)){case"ok":c.success&&c.success(b);break;case"cancel":c.cancel&&c.cancel(b);break;default:c.fail&&c.fail(b)}c.complete&&c.complete(b)}function i(a,b){var d,e,f,g;if(b){switch(d=b.indexOf(":"),a){case p.config:e="config";break;case p.openProductSpecificView:e="openProductSpecificView";break;default:e=b.substring(0,d),e=e.replace(/_/g," "),e=e.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}),e=e.substring(0,1).toLowerCase()+e.substring(1),e=e.replace(/ /g,""),-1!=e.indexOf("Wcpay")&&(e=e.replace("Wcpay","WCPay")),f=q[e],f&&(e=f)}g=b.substring(d+1),"confirm"==g&&(g="ok"),-1!=g.indexOf("failed_")&&(g=g.substring(7)),-1!=g.indexOf("fail_")&&(g=g.substring(5)),g=g.replace(/_/g," "),g=g.toLowerCase(),("access denied"==g||"no permission to execute"==g)&&(g="permission denied"),"config"==e&&"function not exist"==g&&(g="ok"),b=e+":"+g}return b}function j(a){var b,c,d,e;if(a){for(b=0,c=a.length;c>b;++b)d=a[b],e=p[d],e&&(a[b]=e);return a}}function k(a,b){if(A.debug&&!b.isInnerInvoke){var c=q[a];c&&(a=c),b&&b._complete&&delete b._complete,console.log('"'+a+'",',b||"")}}function l(){if(!("6.0.2">x)){var b=new Image;z.appId=A.appId,z.initTime=y.initEndTime-y.initStartTime,z.preVerifyTime=y.preVerifyEndTime-y.preVerifyStartTime,D.getNetworkType({isInnerInvoke:!0,success:function(a){z.networkType=a.networkType;var c="https://open.weixin.qq.com/sdk/report?v="+z.version+"&o="+z.isPreVerifyOk+"&s="+z.systemType+"&c="+z.clientVersion+"&a="+z.appId+"&n="+z.networkType+"&i="+z.initTime+"&p="+z.preVerifyTime+"&u="+z.url;b.src=c}})}}function m(){return(new Date).getTime()}function n(b){u&&(a.WeixinJSBridge?b():r.addEventListener&&r.addEventListener("WeixinJSBridgeReady",b,!1))}function o(){D.invoke||(D.invoke=function(b,c,d){a.WeixinJSBridge&&WeixinJSBridge.invoke(b,e(c),d)},D.on=function(b,c){a.WeixinJSBridge&&WeixinJSBridge.on(b,c)})}var p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;if(!a.jWeixin)return p={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest"},q=function(){var b,a={};for(b in p)a[p[b]]=b;return a}(),r=a.document,s=r.title,t=navigator.userAgent.toLowerCase(),u=-1!=t.indexOf("micromessenger"),v=-1!=t.indexOf("android"),w=-1!=t.indexOf("iphone")||-1!=t.indexOf("ipad"),x=function(){var a=t.match(/micromessenger\/(\d+\.\d+\.\d+)/)||t.match(/micromessenger\/(\d+\.\d+)/);return a?a[1]:""}(),y={initStartTime:m(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},z={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:w?1:v?2:-1,clientVersion:x,url:encodeURIComponent(location.href)},A={},B={_completes:[]},C={state:0,res:{}},n(function(){y.initEndTime=m()}),D={config:function(a){A=a,k("config",a),n(function(){c(p.config,{verifyJsApiList:j(A.jsApiList)},function(){B._complete=function(a){y.preVerifyEndTime=m(),C.state=1,C.res=a},B.success=function(){z.isPreVerifyOk=0},B.fail=function(a){B._fail?B._fail(a):C.state=-1};var a=B._completes;return a.push(function(){A.debug||l()}),B.complete=function(b){for(var c=0,d=a.length;d>c;++c)a[c](b);B._completes=[]},B}()),y.preVerifyStartTime=m()}),A.beta&&o()},ready:function(a){0!=C.state?a():(B._completes.push(a),!u&&A.debug&&a())},error:function(a){"6.0.2">x||(-1==C.state?a(C.res):B._fail=a)},checkJsApi:function(a){var b=function(a){var c,d,b=a.checkResult;for(c in b)d=q[c],d&&(b[d]=b[c],delete b[c]);return a};c("checkJsApi",{jsApiList:j(a.jsApiList)},function(){return a._complete=function(a){if(v){var c=a.checkResult;c&&(a.checkResult=JSON.parse(c))}a=b(a)},a}())},onMenuShareTimeline:function(a){d(p.onMenuShareTimeline,{complete:function(){c("shareTimeline",{title:a.title||s,desc:a.title||s,img_url:a.imgUrl,link:a.link||location.href},a)}},a)},onMenuShareAppMessage:function(a){d(p.onMenuShareAppMessage,{complete:function(){c("sendAppMessage",{title:a.title||s,desc:a.desc||"",link:a.link||location.href,img_url:a.imgUrl,type:a.type||"link",data_url:a.dataUrl||""},a)}},a)},onMenuShareQQ:function(a){d(p.onMenuShareQQ,{complete:function(){c("shareQQ",{title:a.title||s,desc:a.desc||"",img_url:a.imgUrl,link:a.link||location.href},a)}},a)},onMenuShareWeibo:function(a){d(p.onMenuShareWeibo,{complete:function(){c("shareWeiboApp",{title:a.title||s,desc:a.desc||"",img_url:a.imgUrl,link:a.link||location.href},a)}},a)},startRecord:function(a){c("startRecord",{},a)},stopRecord:function(a){c("stopRecord",{},a)},onVoiceRecordEnd:function(a){d("onVoiceRecordEnd",a)},playVoice:function(a){c("playVoice",{localId:a.localId},a)},pauseVoice:function(a){c("pauseVoice",{localId:a.localId},a)},stopVoice:function(a){c("stopVoice",{localId:a.localId},a)},onVoicePlayEnd:function(a){d("onVoicePlayEnd",a)},uploadVoice:function(a){c("uploadVoice",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},downloadVoice:function(a){c("downloadVoice",{serverId:a.serverId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},translateVoice:function(a){c("translateVoice",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},chooseImage:function(a){c("chooseImage",{scene:"1|2"},function(){return a._complete=function(a){if(v){var b=a.localIds;b&&(a.localIds=JSON.parse(b))}},a}())},previewImage:function(a){c(p.previewImage,{current:a.current,urls:a.urls},a)},uploadImage:function(a){c("uploadImage",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},downloadImage:function(a){c("downloadImage",{serverId:a.serverId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},getNetworkType:function(a){var b=function(a){var c,d,e,b=a.errMsg;if(a.errMsg="getNetworkType:ok",c=a.subtype,delete a.subtype,c)a.networkType=c;else switch(d=b.indexOf(":"),e=b.substring(d+1)){case"fail":case"permission denied":case"localparameters":a.errMsg="getNetworkType:fail";break;default:a.networkType=e}return a};c("getNetworkType",{},function(){return a._complete=function(a){a=b(a)},a}())},openLocation:function(a){c("openLocation",{latitude:a.latitude,longitude:a.longitude,name:a.name||"",address:a.address||"",scale:a.scale||28,infoUrl:a.infoUrl||""},a)},getLocation:function(a){c(p.getLocation,function(){return a.type="wgs84",f(a,"jsapi_location")}(),function(){return a._complete=function(a){delete a.type},a}())},hideOptionMenu:function(a){c("hideOptionMenu",{},a)},showOptionMenu:function(a){c("showOptionMenu",{},a)},closeWindow:function(a){c("closeWindow",{immediate_close:a&&a.immediateClose||0},a)},hideMenuItems:function(a){c("hideMenuItems",{menuList:a.menuList},a)},showMenuItems:function(a){c("showMenuItems",{menuList:a.menuList},a)},hideAllNonBaseMenuItem:function(a){c("hideAllNonBaseMenuItem",{},a)},showAllNonBaseMenuItem:function(a){c("showAllNonBaseMenuItem",{},a)},scanQRCode:function(a){c("scanQRCode",{desc:a.desc,needResult:a.needResult||0,scanType:a.scanType||["qrCode","barCode"]},a)},openProductSpecificView:function(a){c(p.openProductSpecificView,{pid:a.productId,view_type:a.viewType||0},a)},addCard:function(a){var e,f,g,h,b=a.cardList,d=[];for(e=0,f=b.length;f>e;++e)g=b[e],h={card_id:g.cardId,card_ext:g.cardExt},d.push(h);c(p.addCard,{card_list:d},function(){return a._complete=function(a){var c,d,e,b=a.card_list;if(b){for(b=JSON.parse(b),c=0,d=b.length;d>c;++c)e=b[c],e.cardId=e.card_id,e.cardExt=e.card_ext,e.isSuccess=e.is_succ?!0:!1,delete e.card_id,delete e.card_ext,delete e.is_succ;a.cardList=b,delete a.card_list}},a}())},chooseCard:function(a){c("chooseCard",{app_id:A.appId,location_id:a.shopId||"",sign_type:"SHA1",card_id:a.cardId||"",card_type:a.cardType||"",card_sign:a.cardSign,time_stamp:a.timestamp+"",nonce_str:a.nonceStr},function(){return a._complete=function(a){a.cardList=a.choose_card_info,delete a.choose_card_info},a}())},openCard:function(a){var e,f,g,h,b=a.cardList,d=[];for(e=0,f=b.length;f>e;++e)g=b[e],h={card_id:g.cardId,code:g.code},d.push(h);c(p.openCard,{card_list:d},a)},chooseWXPay:function(a){c(p.chooseWXPay,g(a),a)}},b&&(a.wx=a.jWeixin=D),D});
</script>
<script type="text/javascript">
$(function() {
    $('[data-adjustHeight]').each(function(){
            var $this = $(this);
            var index = $this.index();
            var $other;
            if(index % 2 == 0){
                $other = $this.next();
            }else{
                $other = $this.prev();
            }

            if($other.length <= 0)
                return;

            var thisH = $this.height();
            var otherH = $other.height();
            var height = Math.max(thisH, otherH);

            if(thisH != otherH){
                $this.height(height);
                $other.height(height);
            }
        });
        $('[data-longinfo]').on('click', function(e){
            var title = $(this).data('longinfo');
            var content = $(this).find('span').html();
            var $longInfo = $('[data-block="longInfo"]');
            $longInfo.find('h3').html(title + ' :');
            $longInfo.find('p').html(content);

            $longInfo.show();
            $longInfo.find('[data-action="closeTip"]').one('click', function(e){
                $longInfo.hide();
            });
        });

    $('[data-action="navUrl"]').on('click', function(e){
        var withUrl = {
            weixinPub: '',
            sinaweibo: '',
            txweibo: ''
        };
        var type = $(this).data('field');
        var url = withUrl[type]
        if(url){
            window.open(url);
        }
    });
    $('.show-qr-button').on('click', function(e) {
        $('.show-qr').show().find('i').one('click', function(e) {
            $(this).parent().hide();
        });
    });
    $('[data-tel]').on('click', function(e) {
        var tel = $(this).data('tel') + '';
        if (tel) {
            var tmp = tel.split('-');
            if(tmp.length > 2){
                tmp = tmp.splice(0, 2);
                tel = tmp.join('-');
            }else if(tmp.length == 2 && tmp[0].length > 4){
                tel = tmp[0];
            }
            location.href = "tel:" + tel;
        }
    });
    $('[data-mail]').on('click', function(e){
        var email = $(this).data('mail');
        if(email){
            location.href = 'mailto:' + email;
        }
    });

    $('[data-qq]').on('click', function(e){
        var qq = $(this).data('qq');
        if(qq){
            location.href = 'mqqwpa://im/chat?chat_type=wpa&uin='+qq+'&version=1&src_type=web&web_src=http://b.qq.com';
        }
    });
    $('[data-url]').on('click', function(e) {
        var url = $(this).data('url');
        if (url) {
            location.href = url;
            return ;
        }
        if ($(this).is('.website')) {
            $('.tip-nosite').show().one('click', function(e){
                $(this).hide();
            });
        }
    });
    $('.cardAddress').on('click', function(e) {
        location.href = 'http://api.map.baidu.com/marker?output=html&src=handka&location=coordinate&title=intertid&content='.replace('coordinate', ''.split(',').reverse().join(','));
    });

    $('.wx-shareto').on('click', function(e){
        var makeLink = '{$setting['guanzhuUrl']}';
        if(makeLink){
            location.href = makeLink;
        }else{
            var redUrl = '/mobile?referId=';
            if(device.isWeixin){
                redUrl = '{$setting['guanzhuUrl']}'
            }
            location.href = redUrl;
        }
    });

    $('.download-vcf').on('click', function(e){
        if (device.os.android || device.os.ios) {
            location.href = '/assets/card/download-tip.html#/files/card/b49c0f8607bc49de9c137a00dd01f4e1/vcard/e653ab447f124996b6edec9ba4b2bb3e';
        } else {
            location.href = '/files/card/b49c0f8607bc49de9c137a00dd01f4e1/vcard/e653ab447f124996b6edec9ba4b2bb3e';
        }
    })
});
</script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script language='javascript'>
    <?php
        $jssdk = new JSSDK();
        $signPackage = $jssdk->GetSignPackage();
    ?>
    wx.config({
        debug:false,
        appId: "{$_W['account']['appid_share']}",
        timestamp: {$signPackage["timestamp"]},
        nonceStr: '{$signPackage["nonceStr"]}',
        signature: '{$signPackage["signature"]}',
        jsApiList: [
            'onMenuShareTimeline','onMenuShareAppMessage','onMenuShareWeibo'
        ]
    });
    var shareMeta = {
        imgUrl:"{$shareimg}",
        link:"{$sharelink}",
        desc:"{$weicard['company']}",
        title:"{$weicard['name']}"
    };
    wx.ready(function(){
        wx.onMenuShareTimeline(shareMeta);
        wx.onMenuShareAppMessage(shareMeta);
        wx.onMenuShareWeibo(shareMeta);
    });
</script>

</body>
</html>

